package com.lyx.server.controller;


import com.lyx.common.param.UserCouponAdd;
import com.lyx.common.vo.R;
import com.lyx.server.service.UserCouponService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * ⽤户优惠券表(UserCoupon)表控制层
 *
 * @author McMeloxD
 * @since 2024-08-14 17:41:03
 */
@RestController
@RequestMapping("server/usercoupon")
public class UserCouponController  {
    /**
     * 服务对象
     */
    @Resource
    private UserCouponService service;
    @PostMapping("add")
    public R add(@RequestBody UserCouponAdd add){
        return service.save(add);
    }
    @GetMapping("my")
    public R my(Integer uid){
        return service.queryByUid(uid);
    }

    @GetMapping("addnew")
    public Integer addNew(Integer uid){
        return service.saveNew(uid);
    }

    @GetMapping("addask")
    public Integer addAsk(Integer uid){
        return service.saveAsk(uid);
    }
}

